import 'package:flutter/material.dart';
import 'package:mall/constant/app_colors.dart';
import 'package:mall/gen/r.dart';
import 'package:mall/ui/widgets/default_bg.dart';
import 'package:mall/utils/image_component/image_component.dart';

class SquarePubPage extends StatefulWidget {
  const SquarePubPage({super.key});

  @override
  State<SquarePubPage> createState() => _SquarePubPageState();
}

class _SquarePubPageState extends State<SquarePubPage> {
  /// 备注输入控制器
  final TextEditingController remarkInputCtrl = TextEditingController();

  @override
  Widget build(BuildContext context) {
    return APPScaffold(
      title: '发布动态',
      actions: [
        InkWell(
          child: Container(
            margin: EdgeInsets.only(right: 15),
            height: 26,
            width: 45,
            alignment: Alignment.center,
            decoration: BoxDecoration(
              color: AppColors.C_FD2C55,
              borderRadius: BorderRadius.circular(13),
            ),
            child: Text(
              '发布',
              style: TextStyle(fontSize: 12, color: AppColors.C_FFFFFF),
            ),
          ),
        )
      ],
      body: SingleChildScrollView(
        padding: EdgeInsets.all(15),
        child: Container(
          height: 270,
          padding: EdgeInsets.symmetric(vertical: 20, horizontal: 15),
          decoration: BoxDecoration(
            color: Colors.white,
            borderRadius: BorderRadius.circular(10),
          ),
          child: Column(
            crossAxisAlignment: CrossAxisAlignment.start,
            children: [
              //输入内容
              Expanded(
                child: TextField(
                  controller: remarkInputCtrl,
                  maxLength: 500,
                  maxLines: 10,
                  style: TextStyle(
                    color: AppColors.C_222222,
                    fontSize: 13,
                  ),
                  decoration: InputDecoration(
                    border: InputBorder.none,
                    // counterText: '',
                    hintText: '此时此刻，向世界点亮你的火花..',
                    hintStyle: TextStyle(
                      color: AppColors.C_999999,
                      fontSize: 13,
                    ),
                  ),
                ),
              ),
              //添加图片
              InkWell(
                  child: ImageComponent(
                R.image.squareFabuAddimage.path,
                size: 83,
              ))
            ],
          ),
        ),
      ),
    );
  }
}
